<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <meta http-equiv="pragma" content="no-cache">
  <meta http-equiv="cache-control" content="no-cache">
  <meta http-equiv="expires" content="0">
  <!-- 作者 -->
  <meta name="author" content="浙江卡易智慧医疗科技有限公司">
  <!-- 网页描述 -->
  <meta name="description" content="医技检查集中预约平台">
  <!-- 关键字使用","分隔 -->
  <meta name="keywords" content="医技检查集中预约平台">
  <!-- 用来防止别人在框架里调用你的页面 -->
  <meta http-equiv="Window-target" content="_top">

  <title>医技检查集中预约平台</title>
  <% if ( htmlWebpackPlugin.options.node_env_prod ) { %>
  <script type="text/javascript" src="/config.js?v=<%=htmlWebpackPlugin.options.version_time%>"></script>
  <% } %>
  <% if ( htmlWebpackPlugin.options.node_env_dev ) { %>
  <script type="text/javascript" src="/static/config.js"></script>
  <% } %>

  <!-- <script src="https://cdn.ckeditor.com/4.8.0/full-all/ckeditor.js"></script> -->
  <script type="text/javascript">
    var timestramp = +new Date();
    (
      function(){
        if(window.g.TITLE) {
          document.title = window.g.TITLE;
        <% if ( htmlWebpackPlugin.options.node_env_prod ) { %>
          window.g.VERSION = '<%=htmlWebpackPlugin.options.version_time%>';
        <% } %>
        <% if ( htmlWebpackPlugin.options.node_env_dev ) { %>  //dev 环境缓存了 不能及时联动临床的很尴尬
          window.g.VERSION = '<%=htmlWebpackPlugin.options.version_time%>'+ timestramp;
        <% } %>
        }
      }
    )()

    var getLcVersion = function (version) {
      if(window.g.lcVERSION) {
        window.g.isLcUpdate = (window.g.lcVERSION !== version.version) ? true : false
      }
      window.g.lcVERSION = version.version;
    };

    var sendJSONPRequest = function (url, callback) {
      var script = document.createElement("script");
      script.src = url + "?v=" + (+new Date())+"&getLcVersion=" + callback;
      document.body.appendChild(script);
      return script;
    };

    var checkNewVersion = function (callBack, lcCallBack) {
      var xhr = new XMLHttpRequest();
      xhr.open('GET','/static/app.json?time='+ (+new Date()) , false);
      xhr.onreadystatechange = function () {
        if (xhr.readyState === 4) {
          try {
        <% if ( htmlWebpackPlugin.options.node_env_prod ) { %>
            if(JSON.parse(xhr.responseText).version !== window.g.VERSION){
        <% } %>
        <% if ( htmlWebpackPlugin.options.node_env_dev ) { %>  //dev 环境缓存了 不能及时联动临床的很尴尬
            if((JSON.parse(xhr.responseText).version + timestramp) !== window.g.VERSION){
        <% } %>
                callBack()
            } else {
              var tempLcVersion = window.g.lcVERSION;
              <% if ( htmlWebpackPlugin.options.node_env_prod ) { %>
                  var configSrc = '/config.js?version=' + (+new Date());
                <% } %>
              <% if ( htmlWebpackPlugin.options.node_env_dev ) { %>  //dev 环境缓存了 不能及时联动临床的很尴尬
                  var configSrc = '/static/config.js?version=' + (+new Date());
                <% } %>
                var xhr1 = new XMLHttpRequest();
                xhr1.open('GET', configSrc, false);
                xhr1.onreadystatechange = function () {
                  if (xhr1.readyState === 4) {
                  <% if ( htmlWebpackPlugin.options.node_env_prod ) { %>
                      window.g.VERSION = '<%=htmlWebpackPlugin.options.version_time%>';
                    <% } %>
                  <% if ( htmlWebpackPlugin.options.node_env_dev ) { %>  //dev 环境缓存了 不能及时联动临床的很尴尬
                      window.g.VERSION = '<%=htmlWebpackPlugin.options.version_time%>'+ timestramp;
                    <% } %>
                    if(tempLcVersion !== window.g.lcVERSION) {
                      if(typeof lcCallBack == 'function') lcCallBack();
                    }
                  }
                }
                xhr1.send(null);
            }
          }catch(e){}
        }
      };
      xhr.send(null);
    }
  </script>
  <script type="text/javascript" src="/static/js/protocolcheck.js"></script>
</head>
<body>
  <div id="app"></div>
  <script type="text/javascript" src="/static/js/browser.js"></script>
  <script type="text/javascript" src="/static/js/dll/vendor.dll.js"></script>
  <script type="text/javascript" src="/static/js/dict/pinyin_dict_withtone.js"></script>
  <script type="text/javascript" src="/static/js/pinyinUtil.js"></script>
</body>

</html>
